package com.egao.common.core.damon.baiduword.entity;

/**
 * @author Damon
 * @create 2020-08-27 11:35
 */
public class BaiduwordAccessToken {
    public BaiduwordAccessToken(String accessToken, String expireIn) {
        this.accessToken = accessToken;
        this.expireTime = System.currentTimeMillis() + 2592000 * 1000;
    }

    /**
     * 判断token是否过期
     * @return
     */
    public boolean isExpired() {
        return System.currentTimeMillis() > this.expireTime;
    }

    private String accessToken;
    private long expireTime;


    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }
}
